<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<!DOCTYPE html>
<%@ page import="domain.User" %>
<%@ include file="time.jsp" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>补充信息</title>
    <script type="text/javascript">
        $(function () {
            if ($("#AddInfoResult").length > 0) {
                alert($("#AddInfoResult").text());
            }
        });
    </script>
</head>
<body style="text-align:center;">
<%
    Object obj = session.getAttribute("user");
    User user = (User) obj;
    if (null == obj) {
%>
您尚未登陆，请登录！
<a href="login.jsp" name="login">去登录</a>
<a href="register.jsp" name="register">跳转注册</a>
<%
} else {
%>
<form action="AddInfoServlet" method="post">
    <input type="hidden" name="username" value=<%=user.getUsername() %>>
    <div style="text-align:center; padding-right: 10px;">
        当前用户:<%=user.getUsername() %>
        <a href="exit.jsp" name="exit">退出登录</a>
        <a href="login_success.jsp" name="success">返回</a>
    </div>
    <table border="1px" align="center">
        <div align="center">
            <h2>补充信息</h2></div>
        <tr align="center">
            <td align="justify">
                真名:&nbsp;<input type="text" name="realname" size=10 maxlength=20/><br/></td>
            <td align="justify">
                电话:&nbsp;<input type="text" name="phone" size=12 maxlength=16/>（11位手机号）<br/></td><!-- 限长16允许带+ -->
            <td align="justify">
                生日:&nbsp;<input type="text" name="birth" size=11
                                  maxlength=11/>（格式:1977-12-14或者1977年12月14日）<br/></td>
            <td align="justify">
                <input type="submit" value="提交" name="submit">
                &nbsp;&nbsp;<input type="reset" value="重置" name="reset"></td>
        </tr>
    </table>
</form>
<%
    Object result = request.getAttribute("AddInfoResult");
    if (result != null) {
%>
<br>
<h2><%=(String) result%>
</h2>
<%
    }
%>
<%}%>

</body>
</html>